package topcoder.tco2004;

public class SchoolAssembly {
	public int getBeans(int kids, int quantity) {
		int ans = 1;
		int total = kids * quantity;

		int bags = 0;
		int nKids = 0;

		if (quantity % 4 == 0) {
			bags = quantity / 4;
		} else
			bags = (quantity / 4) + 1;
		
		nKids = (int)Math.ceil(kids/ Math.round((bags * 20.0) / quantity));
		
		nKids *= bags;
		

		System.out.println("bags = " + bags + ", nKids = " + nKids
				+ ", total = " + total);

		return ans;
	}

	public static void main(String[] args) {
		SchoolAssembly sa = new SchoolAssembly();
		System.out.println(sa.getBeans(223, 15));
	}

}
